#include "Object.h"
#include "Rect.h"
#include "Vector.h"
#include "AnimationSprite.h"
#include "Utils.h"

Object::Object()
{
	rect = new Rect();
	aniSprite = new AnimationSprite();
	pos = new Vector();
}

Object::Object(float x, float y, int width, int height, int classID)
{
	rect = new Rect();
	aniSprite = new AnimationSprite();
	pos = new Vector(x, y);
	
	this->width = width;
	this->height = height;

	this->classID = classID;
	this->state = 0;

	UpdateRect();
}

void Object::UpdateRect()
{
	rect->Set(pos->x, pos->y, width, height);
}

Object::~Object()
{
	DELETE_SAFELY(rect);
	DELETE_SAFELY(aniSprite);
	DELETE_SAFELY(pos);
}